import request from "@/utils/request"
export type instantType={
    context:string
    userId?:number
}

export type instantlist={
    id?:number
    userId?:number
    title?:string
    context:string
    img?:string
    likeNum?:number
    username:string
    created_at:string
    commentNum:number
    showFlag:boolean
    flag:boolean
    showLoading:boolean
}
export type responseDataByid = {
    list:Array<instantlist>
    count:number
}
export const createInstant=(data:instantType)=>{
    return request({
        url:"/api/instant/create",
        method:"post",
        data
    })
}

export const getListById=(params:Record<string,number>)=>{
    return request<responseDataByid>({
        url:"/api/instant/list",
        method:"get",
        params
    })
}


export const createlike=(data:Record<string,number>)=>{
    return request({
        url:"/api/like/create",
        method:"post",
        data
    })
}